clear 

* set directory 
* cd "directory"

* set paths
global datafolder "data"
global outputfolder "output"

********************************************************************************
*			Figure 1: Greek GDP growth vs CIPS
********************************************************************************
	use "$datafolder\gdp.dta", clear

	gen totalGDP_others = Cyprus_RealGDPindomesticcurr ///
				+ Italy_RealGDPindomesticcurre ///
				+ Portgual_RealGDPindomesticcu + Spain_RealGDPindomesticcurre
				
	gen Cyprus_w = Cyprus_RealGDPindomesticcurr/totalGDP_others
	gen Italy_w = Italy_RealGDPindomesticcurre/totalGDP_others
	gen Portugal_w = Portgual_RealGDPindomesticcu/totalGDP_others
	gen Spain_w = Spain_RealGDPindomesticcurre/totalGDP_others

	gen avg_others = (Cyprus_GDPGr + Italy_GDPGr + Portugal_GDPGr + Spain_GDPGr)/4
	gen wavg_others = ( Cyprus_w * Cyprus_GDPGr + Italy_w * Italy_GDPGr ///
					+ Portugal_w * Portugal_GDPGr + Spain_w * Spain_GDPGr)

	gen DateQ = string(Date,"%tq")
		
* GDP Growth (Greece vs. weighted average of CIPS)
	graph bar wavg_others Greece_GDPGrowth if inrange(Date,212,227), ///
	over(DateQ, label(labsize(*0.75) angle(vertical)) ) ///
	title("", color(black)) ytitle("Percent") ylabel(,angle(horizontal)) ///
	graphregion(color(white)) legend(label(1 "Weighted Avg. CIPS") label(2 "Greece") ///
	region(lcolor(white) fcolor(none)) cols(3) pos(6)) ///
	bar(1, fintensity(inten60) lwidth(none)) bar(2, color(red)) 
		
	graph export "$outputfolder/figure_1.pdf", as(pdf) replace
	graph export "$outputfolder/figure_1.png", as(png) replace
















